package UnitTest.DataStructureTest.treeTest.binaryTreeTest.binaryTreeApplyTest;

import DataStructure.tree.binaryTree.binaryTreeApply.BT_PrintLeftView;
import TestData.DataStructureTestData.treeTestData.binaryTreeTestData.BinaryTreeBuildDemo;
import TestData.DataStructureTestData.treeTestData.binaryTreeTestData.BinaryTreeTestDemo;
import UnitTest.DataStructureTest.treeTest.binaryTreeTest.binaryTreeTestData.BT_TestData_Tree;
import org.junit.Test;

import java.util.Arrays;

/**
 * @author liujun
 * @version 1.0
 * @date 2021/1/8
 * @author—Email ljfirst@mail.ustc.edu.cn
 * @blogURL https://blog.csdn.net/ljfirst
 * @description 树的左视图 测试案例
 */
public class BT_PrintLeftViewTest extends BT_TestData_Tree {

    BT_PrintLeftView leftView = new BT_PrintLeftView();

    @Test
    public void testprint() {
        int[] target = leftView.print(Tree_BT_Full_Level_WithNLF_1());
        assert Arrays.equals(target, answer01);
        target = leftView.print(Tree_BT_Full_Level_WithNLF_2());
        assert Arrays.equals(target, answer02);
        target = leftView.print(Tree_BT_Full_Level_WithNLF_3());
        assert Arrays.equals(target, answer03);
        target = leftView.print(Tree_BT_Full_Level_WithNLF_4());
        assert Arrays.equals(target, answer04);
    }

    int[] answer01 = {1};
    int[] answer02 = {1, 2};
    int[] answer03 = {1, 2, 4};
    int[] answer04 = {1, 2, 4, 8};
    int[] answer05 = new int[]{};
    int[] answer06 = {1, 2, 4, 8};
}
